let op = {};
let arrresources = JSON.parse(sessionStorage.getItem('resources'));
let oneLevelArr = [];
function getPer(arr) {
  for(let i = 0;i<arr.length;i++){
    if(arr[i]['children'] && arr[i]['children'].length){
      getPer(arr[i]['children'])
    }
    oneLevelArr.push(arr[i])
  }
}
const openFun = function (name) {
  op = {};
  oneLevelArr = [];
  getPer(JSON.parse(sessionStorage.getItem('resources')));
  for(let i = 0;i<oneLevelArr.length;i++){
    if(String(oneLevelArr[i]['icon']) === name ) {
      op[oneLevelArr[i]['resourceMark']] =  Number(oneLevelArr[i]['resourceType']) === 1;
    }
  }
  return op;
};
export default openFun
